
// MIT License
// 
// Copyright (c) 2009-2017 Luca Piccioni
// 
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
// 
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
// 
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
// 
// This file is automatically generated

#pragma warning disable 649, 1572, 1573

// ReSharper disable RedundantUsingDirective
using System;
using System.Diagnostics;
using System.Runtime.InteropServices;
using System.Security;
using System.Text;

using Khronos;

// ReSharper disable CheckNamespace
// ReSharper disable InconsistentNaming
// ReSharper disable JoinDeclarationAndInitializer

namespace OpenGL
{
	public partial class Wgl
	{
		/// <summary>
		/// [WGL] Value of WGL_OPTIMAL_PBUFFER_WIDTH_EXT symbol.
		/// </summary>
		[RequiredByFeature("WGL_EXT_pbuffer")]
		public const int OPTIMAL_PBUFFER_WIDTH_EXT = 0x2031;

		/// <summary>
		/// [WGL] Value of WGL_OPTIMAL_PBUFFER_HEIGHT_EXT symbol.
		/// </summary>
		[RequiredByFeature("WGL_EXT_pbuffer")]
		public const int OPTIMAL_PBUFFER_HEIGHT_EXT = 0x2032;

		/// <summary>
		/// [WGL] wglCreatePbufferEXT: Binding for wglCreatePbufferEXT.
		/// </summary>
		/// <param name="hDC">
		/// A <see cref="T:IntPtr"/>.
		/// </param>
		/// <param name="iPixelFormat">
		/// A <see cref="T:int"/>.
		/// </param>
		/// <param name="iWidth">
		/// A <see cref="T:int"/>.
		/// </param>
		/// <param name="iHeight">
		/// A <see cref="T:int"/>.
		/// </param>
		/// <param name="piAttribList">
		/// A <see cref="T:int[]"/>.
		/// </param>
		[RequiredByFeature("WGL_EXT_pbuffer")]
		public static IntPtr CreatePbufferEXT(IntPtr hDC, int iPixelFormat, int iWidth, int iHeight, int[] piAttribList)
		{
			IntPtr retValue;

			unsafe {
				fixed (int* p_piAttribList = piAttribList)
				{
					Debug.Assert(Delegates.pwglCreatePbufferEXT != null, "pwglCreatePbufferEXT not implemented");
					retValue = Delegates.pwglCreatePbufferEXT(hDC, iPixelFormat, iWidth, iHeight, p_piAttribList);
					LogCommand("wglCreatePbufferEXT", retValue, hDC, iPixelFormat, iWidth, iHeight, piAttribList					);
				}
			}
			DebugCheckErrors(retValue);

			return (retValue);
		}

		/// <summary>
		/// [WGL] wglGetPbufferDCEXT: Binding for wglGetPbufferDCEXT.
		/// </summary>
		/// <param name="hPbuffer">
		/// A <see cref="T:IntPtr"/>.
		/// </param>
		[RequiredByFeature("WGL_EXT_pbuffer")]
		public static IntPtr GetPbufferDCEXT(IntPtr hPbuffer)
		{
			IntPtr retValue;

			Debug.Assert(Delegates.pwglGetPbufferDCEXT != null, "pwglGetPbufferDCEXT not implemented");
			retValue = Delegates.pwglGetPbufferDCEXT(hPbuffer);
			LogCommand("wglGetPbufferDCEXT", retValue, hPbuffer			);
			DebugCheckErrors(retValue);

			return (retValue);
		}

		/// <summary>
		/// [WGL] wglReleasePbufferDCEXT: Binding for wglReleasePbufferDCEXT.
		/// </summary>
		/// <param name="hPbuffer">
		/// A <see cref="T:IntPtr"/>.
		/// </param>
		/// <param name="hDC">
		/// A <see cref="T:IntPtr"/>.
		/// </param>
		[RequiredByFeature("WGL_EXT_pbuffer")]
		public static int ReleasePbufferDCEXT(IntPtr hPbuffer, IntPtr hDC)
		{
			int retValue;

			Debug.Assert(Delegates.pwglReleasePbufferDCEXT != null, "pwglReleasePbufferDCEXT not implemented");
			retValue = Delegates.pwglReleasePbufferDCEXT(hPbuffer, hDC);
			LogCommand("wglReleasePbufferDCEXT", retValue, hPbuffer, hDC			);
			DebugCheckErrors(retValue);

			return (retValue);
		}

		/// <summary>
		/// [WGL] wglDestroyPbufferEXT: Binding for wglDestroyPbufferEXT.
		/// </summary>
		/// <param name="hPbuffer">
		/// A <see cref="T:IntPtr"/>.
		/// </param>
		[RequiredByFeature("WGL_EXT_pbuffer")]
		public static bool DestroyPbufferEXT(IntPtr hPbuffer)
		{
			bool retValue;

			Debug.Assert(Delegates.pwglDestroyPbufferEXT != null, "pwglDestroyPbufferEXT not implemented");
			retValue = Delegates.pwglDestroyPbufferEXT(hPbuffer);
			LogCommand("wglDestroyPbufferEXT", retValue, hPbuffer			);
			DebugCheckErrors(retValue);

			return (retValue);
		}

		/// <summary>
		/// [WGL] wglQueryPbufferEXT: Binding for wglQueryPbufferEXT.
		/// </summary>
		/// <param name="hPbuffer">
		/// A <see cref="T:IntPtr"/>.
		/// </param>
		/// <param name="iAttribute">
		/// A <see cref="T:int"/>.
		/// </param>
		/// <param name="piValue">
		/// A <see cref="T:int[]"/>.
		/// </param>
		[RequiredByFeature("WGL_EXT_pbuffer")]
		public static bool QueryPbufferEXT(IntPtr hPbuffer, int iAttribute, int[] piValue)
		{
			bool retValue;

			unsafe {
				fixed (int* p_piValue = piValue)
				{
					Debug.Assert(Delegates.pwglQueryPbufferEXT != null, "pwglQueryPbufferEXT not implemented");
					retValue = Delegates.pwglQueryPbufferEXT(hPbuffer, iAttribute, p_piValue);
					LogCommand("wglQueryPbufferEXT", retValue, hPbuffer, iAttribute, piValue					);
				}
			}
			DebugCheckErrors(retValue);

			return (retValue);
		}

		internal static unsafe partial class Delegates
		{
			[RequiredByFeature("WGL_EXT_pbuffer")]
			[SuppressUnmanagedCodeSecurity]
			internal delegate IntPtr wglCreatePbufferEXT(IntPtr hDC, int iPixelFormat, int iWidth, int iHeight, int* piAttribList);

			[RequiredByFeature("WGL_EXT_pbuffer")]
			internal static wglCreatePbufferEXT pwglCreatePbufferEXT;

			[RequiredByFeature("WGL_EXT_pbuffer")]
			[SuppressUnmanagedCodeSecurity]
			internal delegate IntPtr wglGetPbufferDCEXT(IntPtr hPbuffer);

			[RequiredByFeature("WGL_EXT_pbuffer")]
			internal static wglGetPbufferDCEXT pwglGetPbufferDCEXT;

			[RequiredByFeature("WGL_EXT_pbuffer")]
			[SuppressUnmanagedCodeSecurity]
			internal delegate int wglReleasePbufferDCEXT(IntPtr hPbuffer, IntPtr hDC);

			[RequiredByFeature("WGL_EXT_pbuffer")]
			internal static wglReleasePbufferDCEXT pwglReleasePbufferDCEXT;

			[RequiredByFeature("WGL_EXT_pbuffer")]
			[SuppressUnmanagedCodeSecurity]
			internal delegate bool wglDestroyPbufferEXT(IntPtr hPbuffer);

			[RequiredByFeature("WGL_EXT_pbuffer")]
			internal static wglDestroyPbufferEXT pwglDestroyPbufferEXT;

			[RequiredByFeature("WGL_EXT_pbuffer")]
			[SuppressUnmanagedCodeSecurity]
			internal delegate bool wglQueryPbufferEXT(IntPtr hPbuffer, int iAttribute, int* piValue);

			[RequiredByFeature("WGL_EXT_pbuffer")]
			internal static wglQueryPbufferEXT pwglQueryPbufferEXT;

		}
	}

}
